package jp.co.technotree.common.dao;

import java.io.Serializable;
import java.lang.reflect.Array;

public class FindResult implements Serializable{
	private static final long serialVersionUID = 2356315488904275874L;
	private DataAccessBean recordList[] = null;
	private boolean isSuccess = false;
	private int recordCount = 0;
	public int length = 0;
	private Class<?> recordClass = null;
	
	public FindResult(Class<?> cls){
		recordClass = cls;
		recordList = (DataAccessBean[])Array.newInstance(recordClass, 0);
		isSuccess = false;
	}

	public boolean isSuccess() {
		return isSuccess;
	}

	public void setSuccess(boolean isSuccess) {
		this.isSuccess = isSuccess;
	}

	public DataAccessBean[] getRecordList() {
		return recordList;
	}

	public void setRecordList(DataAccessBean[] recordList) {
		this.recordList = recordList;
		this.length = recordList.length;
	}

	public Class<?> getRecordClass() {
		return recordClass;
	}

	public void setRecordClass(Class<?> recordClass) {
		this.recordClass = recordClass;
	}
	
	public DataAccessBean getRecord(int index) {
		return recordList[index];
	}

	public int getRecordCount() {
		return recordCount;
	}

	public void setRecordCount(int recordCount) {
		this.recordCount = recordCount;
	}

	public int getLength() {
		return length;
	}

	public void setLength(int length) {
		this.length = length;
	}

}
